using System;
using System.Data;
using System.Data.Odbc;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Videoplayer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ReviewerMySql SQL = new ReviewerMySql();
        OdbcDataReader MainReader = SQL.ExecuteReader("SELECT V2_Spil.Titel, V2_SpilVideo.* FROM V2_SpilVideo JOIN V2_Spil ON V2_Spil.SpilID = V2_SpilVideo.SpilID WHERE V2_SpilVideo.ID = " + Request.QueryString["ID"].ToString());
        MainReader.Read();

        divVideo.InnerHtml = "<center>";
        divVideo.InnerHtml += "<OBJECT ID=\"MediaPlayer\" width=590 height=580 classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" standby= \"Loading Media Player\" type=\"application/x-oleobject\">";
        //Old CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 - New CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6.
        divVideo.InnerHtml += "<PARAM NAME=\"FileName\" VALUE=\"" + MainReader["Link"].ToString() +"\">";
        divVideo.InnerHtml += "<PARAM NAME=\"AutoStart\" VALUE=\"True\">";
        divVideo.InnerHtml += "<PARAM NAME=\"ShowControls\" VALUE=\"True\">";
        divVideo.InnerHtml += "<PARAM NAME=\"ShowStatusBar\" VALUE=\"True\">";
        divVideo.InnerHtml += "<EMBED type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + MainReader["Link"].ToString() + "\" width=580 height=570 name=\"MediaPlayer\" AutoStart=1 ShowStatusBar=1 ShowControls=1 >";
        divVideo.InnerHtml += "</EMBED></OBJECT></center>";

        lblSpilTitel.Text = MainReader[0].ToString();
        lblSpilDesc.Text = MainReader["Tekst"].ToString();
        this.Title = "Spil Video: " + MainReader[0].ToString();
    }
}
